/**
 * 
 * @author Devin Wolanick
 * @Version 1.0
 * 
 * Card is a Playing Card
 */

public class Card {
	
	/*
	 * Suits: Spades   : 1
	 * 		  Hearts   : 2
	 * 		  Clubs    : 3
	 * 		  Diamonds : 4
	 * 
	 * Numbers: A      : 1
	 * 			2-10   : 2-10
	 * 			J-K    : 11-13
	 */
	/**
	 * Variables
	 */
	private int suit;
	private int number;
	private final String[] cardNumbers = {"A","2","3","4","5","6","7","8","9","10","J","Q","K"};
	private final String[] cardSuits   = {"Spades", "Hearts", "Clubs", "Diamonds"};

	/**
	 * Constructor
	 * @param number Card Number
	 * @param suit   Card Suit
	 */
	public Card (int number, int suit) {
		try {
			if (suit<0 || suit>4)
				throw new Exception();
			if (number<0 || number>13)
				throw new Exception();
		} catch(Exception e){
			System.out.println("Invalid Card Creation");
			System.exit(1);
		}
		
		this.suit = suit;
		this.number = number;
	}
	
	/**
	 * Returns Card Suit
	 * @return Card Suit
	 */
	public int getSuit() {
		return suit;
	}
	
	/**
	 * Returns Card Number
	 * @return Card Number
	 */
	public int getNumber() {
		return number;
	}
	
	public String display() {
		String myString = new String(cardNumbers[(getNumber()-1)]+" of "+cardSuits[(getSuit()-1)]+
				"("+getNumber()+","+getSuit()+")");
		return myString;
	}
}